package chapter02

object Test12_String3 {
  def main(args: Array[String]): Unit = {
    //将字符串中所有的非字符替换成空格
    def notWordToSpace(s:String):String={
      var s1 = ""
      for(i<-s){
        if(i.isLetter){
          s1 = s1+i
        }else{
          s1+=" "
        }
      }
      s1
    }
    println(notWordToSpace("abc34bc"))
  }
}
